home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / misc / elcheapofax.lha / printers / density.c < prev    next >
C/C++ Source or Header  |  1993-04-14  |  990b  |  40 lines

  1.  
  2. /*
  3.  *  DENSITY.C
  4.  *
  5.  *  David Berezowski - March/88.
  6.  *  Modified for DICE - May/91    Matthew Dillon
  7.  *  Modified for ElCheapoFax April 1993 Olaf 'Rhialto' Seibert.
  8.  *
  9.  *  Copyright (c) 1988  Commodore-Amiga, Inc.
  10.  *  (c)Copyright 1991 Matthew Dillon
  11.  *  (c)Copyright 1993 Olaf Seibert
  12.  */
  13.  
  14. #include "defs.h"
  15.  
  16. Prototype short SetDensity(ULONG);
  17.  
  18. short
  19. SetDensity(density_code)
  20. ULONG density_code;
  21. {
  22. #define FINE    Y_DPI
  23. #define CRUDE    Y_DPI/2
  24. #define N    LINE_BITS   /* maybe will support different LINE_BITS_? values later */
  25.  
  26.     /* SPECIAL_DENSITY       0      1     2    3      4     5       6     7 */
  27.     static int YDPI[8] = { CRUDE, CRUDE, CRUDE, CRUDE, FINE, FINE, FINE, FINE };
  28.     static char XPIXELS[8] = {N,  N,     N,    N,     N,    N,    N,     N };
  29.  
  30.     density_code /= SPECIAL_DENSITY1;
  31.  
  32.     /* default is 80 chars (8.0 in.), W_TRACTOR is 136 chars (13.6 in.) */
  33.  
  34.     PED->ped_MaxXDots = XPIXELS[density_code];
  35.     PED->ped_XDotsInch = X_DPI;
  36.     PED->ped_YDotsInch = YDPI[density_code];
  37.  
  38.     return 0;
  39. }
  40.